package com.nextgenapp.fbgraph.util
{
	/**
	 * parse date string from facebook
	 */
	public class DateUtil
	{
		
		/** 
		 * facebook date string format: "2010-11-07T10:00:00+0000"
		 * convert to "2010/11/07 10:00:00 GMT-0000", 
		 * then use flex Date.parse() to parse it.  
		 * 
		 */
		public static function parseDate(dateStr:String):Date {
			var date:Date = null;
			if (dateStr) {
				dateStr = dateStr.replace(/\-/g, "/");
	            dateStr = dateStr.replace("T", " ");
	            dateStr = dateStr.replace("+0000", " GMT-0000");
	            
	            date = new Date(Date.parse(dateStr));
			}
			
			return date;
		}
		

	}
}